/* fontman.h */

#include <stdio.h>
#include <string.h>
#include <libfontman.h>
#include <limits.h>

#define FONTMAN_PROG_NAME       "fontman"

#define FONTMAN_VER_MAJOR       0
#define FONTMAN_VER_MINOR       1
#define FONTMAN_VER_REVISION    0

struct action_desc;
struct action {
    const char *full_name; 
    const char *short_name;
    int (*func)(int, char **);
    struct action_desc *desc;
};

#define loop_actions(idx, item, items) for (idx = 0; \
                                            item = &items[idx], \
                                            item->full_name != NULL; \
                                            idx++)

#define str_equal(str1, str2)          (str1 != NULL && str2 != NULL && \
                                        strcmp(str1, str2) == 0)

#define str_or(str1, str2)             (str1 != NULL ? str1 : str2)

#define has_opt(num, opt)              (argc >= num && \
                                        str_equal(argv[0], opt))

struct action_desc {
    const char *brief;          /* brief description, in one line */
    const char *usage;          /* actions usage, more detailed */
    const char *options;        /* list options, one by one */
};

